3.179 \(\int \frac {\tan ^2(c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx\)

Optimal. Leaf size=63 \[ \frac {2 \tan (c+d x)}{d \sqrt {a \sec (c+d x)+a}}-\frac {2 \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d} \]

[Out]

-2*arctan(a^(1/2)*tan(d*x+c)/(a+a*sec(d*x+c))^(1/2))/d/a^(1/2)+2*tan(d*x+c)/d/(a+a*sec(d*x+c))^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 63, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3887, 321, 203} \[ \frac {2 \tan (c+d x)}{d \sqrt {a \sec (c+d x)+a}}-\frac {2 \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^2/Sqrt[a + a*Sec[c + d*x]],x]

[Out]

(-2*ArcTan[(Sqrt[a]*Tan[c + d*x])/Sqrt[a + a*Sec[c + d*x]]])/(Sqrt[a]*d) + (2*Tan[c + d*x])/(d*Sqrt[a + a*Sec[
c + d*x]])

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 3887

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_.), x_Symbol] :> Dist[(-2*a^(m/2 +
 n + 1/2))/d, Subst[Int[(x^m*(2 + a*x^2)^(m/2 + n - 1/2))/(1 + a*x^2), x], x, Cot[c + d*x]/Sqrt[a + b*Csc[c +
d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m/2] && IntegerQ[n - 1/2]

Rubi steps

\begin {align*} \int \frac {\tan ^2(c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx &=-\frac {(2 a) \operatorname {Subst}\left (\int \frac {x^2}{1+a x^2} \, dx,x,-\frac {\tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}\\ &=\frac {2 \tan (c+d x)}{d \sqrt {a+a \sec (c+d x)}}+\frac {2 \operatorname {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,-\frac {\tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}\\ &=-\frac {2 \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}+\frac {2 \tan (c+d x)}{d \sqrt {a+a \sec (c+d x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.77, size = 119, normalized size = 1.89 \[ \frac {16 \cos ^6\left (\frac {1}{2} (c+d x)\right ) \sec ^4(c+d x) \left (\frac {1}{\sec (c+d x)+1}\right )^{5/2} \left (\sin (c+d x) \sqrt {\cos (c+d x)} \sqrt {\frac {1}{\cos (c+d x)+1}}-\cos (c+d x) \sin ^{-1}\left (\frac {\tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {\frac {1}{\cos (c+d x)+1}}}\right )\right )}{d \sqrt {a (\sec (c+d x)+1)}} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[Tan[c + d*x]^2/Sqrt[a + a*Sec[c + d*x]],x]

[Out]

(16*Cos[(c + d*x)/2]^6*Sec[c + d*x]^4*((1 + Sec[c + d*x])^(-1))^(5/2)*(-(ArcSin[Tan[(c + d*x)/2]/Sqrt[(1 + Cos
[c + d*x])^(-1)]]*Cos[c + d*x]) + Sqrt[Cos[c + d*x]]*Sqrt[(1 + Cos[c + d*x])^(-1)]*Sin[c + d*x]))/(d*Sqrt[a*(1
 + Sec[c + d*x])])

________________________________________________________________________________________

fricas [A]  time = 0.82, size = 235, normalized size = 3.73 \[ \left [-\frac {\sqrt {-a} {\left (\cos \left (d x + c\right ) + 1\right )} \log \left (\frac {2 \, a \cos \left (d x + c\right )^{2} - 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right ) + 1}\right ) - 2 \, \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{a d \cos \left (d x + c\right ) + a d}, \frac {2 \, {\left (\sqrt {a} {\left (\cos \left (d x + c\right ) + 1\right )} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) + \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )\right )}}{a d \cos \left (d x + c\right ) + a d}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+a*sec(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

[-(sqrt(-a)*(cos(d*x + c) + 1)*log((2*a*cos(d*x + c)^2 - 2*sqrt(-a)*sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*co
s(d*x + c)*sin(d*x + c) + a*cos(d*x + c) - a)/(cos(d*x + c) + 1)) - 2*sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*
sin(d*x + c))/(a*d*cos(d*x + c) + a*d), 2*(sqrt(a)*(cos(d*x + c) + 1)*arctan(sqrt((a*cos(d*x + c) + a)/cos(d*x
 + c))*cos(d*x + c)/(sqrt(a)*sin(d*x + c))) + sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*sin(d*x + c))/(a*d*cos(d
*x + c) + a*d)]

________________________________________________________________________________________

giac [B]  time = 1.91, size = 191, normalized size = 3.03 \[ -\frac {\sqrt {2} {\left (\frac {\sqrt {2} \sqrt {-a} \log \left (\frac {{\left | 2 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} - 4 \, \sqrt {2} {\left | a \right |} - 6 \, a \right |}}{{\left | 2 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} + 4 \, \sqrt {2} {\left | a \right |} - 6 \, a \right |}}\right )}{{\left | a \right |} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} + \frac {4 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}\right )}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+a*sec(d*x+c))^(1/2),x, algorithm="giac")

[Out]

-1/2*sqrt(2)*(sqrt(2)*sqrt(-a)*log(abs(2*(sqrt(-a)*tan(1/2*d*x + 1/2*c) - sqrt(-a*tan(1/2*d*x + 1/2*c)^2 + a))
^2 - 4*sqrt(2)*abs(a) - 6*a)/abs(2*(sqrt(-a)*tan(1/2*d*x + 1/2*c) - sqrt(-a*tan(1/2*d*x + 1/2*c)^2 + a))^2 + 4
*sqrt(2)*abs(a) - 6*a))/(abs(a)*sgn(tan(1/2*d*x + 1/2*c)^2 - 1)) + 4*tan(1/2*d*x + 1/2*c)/(sqrt(-a*tan(1/2*d*x
 + 1/2*c)^2 + a)*sgn(tan(1/2*d*x + 1/2*c)^2 - 1)))/d

________________________________________________________________________________________

maple [B]  time = 0.93, size = 116, normalized size = 1.84 \[ \frac {\sqrt {\frac {a \left (1+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}\, \left (\sqrt {2}\, \sin \left (d x +c \right ) \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}-2 \cos \left (d x +c \right )+2\right )}{d \sin \left (d x +c \right ) a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^2/(a+a*sec(d*x+c))^(1/2),x)

[Out]

1/d*(a*(1+cos(d*x+c))/cos(d*x+c))^(1/2)*(2^(1/2)*sin(d*x+c)*arctanh(1/2*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*s
in(d*x+c)/cos(d*x+c)*2^(1/2))*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)-2*cos(d*x+c)+2)/sin(d*x+c)/a

________________________________________________________________________________________

maxima [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+a*sec(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

Timed out

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.02 \[ \int \frac {{\mathrm {tan}\left (c+d\,x\right )}^2}{\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}}} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^2/(a + a/cos(c + d*x))^(1/2),x)

[Out]

int(tan(c + d*x)^2/(a + a/cos(c + d*x))^(1/2), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tan ^{2}{\left (c + d x \right )}}{\sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**2/(a+a*sec(d*x+c))**(1/2),x)

[Out]

Integral(tan(c + d*x)**2/sqrt(a*(sec(c + d*x) + 1)), x)

________________________________________________________________________________________